package unimelb.filesync.common.message;

import org.json.simple.JSONObject;

public class RequestBlockSizeRole implements Jsonable {
    private final long blockSize;

    private final String role;

    public RequestBlockSizeRole(long blockSize, String role) {
        super();
        this.blockSize = blockSize;
        this.role = role;
    }

    public long getBlockSize() {
        return blockSize;
    }

    public String getRole() {
        return role;
    }

    @SuppressWarnings("unchecked")
    @Override
    public String toJson() {
        final JSONObject jsonObject = new JSONObject();
        jsonObject.put("blockSize", blockSize);
        jsonObject.put("role", role);
        return jsonObject.toJSONString();
    }
}
